<!--
 * @Author: your name
 * @Date: 2021-01-11 17:48:59
 * @LastEditTime: 2021-03-08 16:39:01
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /tead-map-element/src/views/oa/service/components/process.vue
-->
<template>
  <table cellpadding="0" cellspacing="0" v-if="$route.query.from != 'new' && process && process.length > 0">
    <tr>
      <td colspan="6" class="oa-form__table-hd">办理意见</td>
    </tr>
    <tr class="_name">
      <td>进度序号</td>
      <td>步骤名称</td>
      <td>办理人</td>
      <td>办理时间</td>
      <td>状态</td>
      <td>办理意见</td>
    </tr>
    <tr v-for="( item, index ) in process " :key="index">
      <td>{{process.length -index}}</td>
      <td>{{item.node_name}}</td>
      <td>{{item.truename}}</td>
      <td>{{item.created_at}}</td>
      <td>
        <el-tag type="success" :hit="false" v-if="item.status == 100">同意</el-tag>
        <el-tag type="danger" :hit="false" v-if="item.status == 75">保留意见</el-tag>
        <el-tag :hit="false" v-if="item.status == 50">委托</el-tag>
        <el-tag type="warning" :hit="false" v-if="item.status == 25">回退</el-tag>
      </td>
      <td>
        <span v-if="item.status == 25">回退</span>
        <!-- <span v-else-if="item.status == 50">委托</span> -->
        <span v-else :title="item.opinion">{{item.opinion}}</span>
        </td>
    </tr>
  </table>
</template>
<script>
// import { process } from '@/api/oa/index.js'
export default {
  data () {
    return {
      // process: []
    }
  },
  props: ['process'],
  created () {
    // console.log(this.departments)
    // if (this.$route.query.from !== 'new') {
    //   this.processDo()
    // }
  },
  mounted () {
    console.log('process', process)
  },
  methods: {
    // processDo () {
    //   const approve = JSON.parse(window.localStorage.getItem('approve'))
    //   const params = {
    //     workflow_id: approve.workflow_id
    //   }
    //   process(params).then(res => {
    //     const { status, data } = res
    //     if (status) {
    //       this.process = data
    //     }
    //   })
    // }
  }
}
</script>
